home *** CD-ROM | disk | FTP | other *** search
/ Aminet 52 / Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso / Aminet / game / patch / WHDIDemos.lzh / Mirage_Forgotten.lha / ForgottenHD / Install-Forgotten < prev    next >
Text File  |  2000-10-04  |  3KB  |  156 lines

  1. ;****************************
  2.  
  3. (set #sub-dir "data")        ;sub directory containing data files
  4. (set #readme-file "README")    ;name of readme file
  5. (set #cleanup "")        ;files to delete after install
  6.  
  7. ;****************************
  8. ;----------------------------
  9. ; checks if given program is installed, if not abort install
  10. ; #program - to check
  11.  
  12. (procedure P_ChkRun
  13.   (if
  14.     (= 0 (run ("cd SYS:\nWhich %s" #program)))
  15.     ("")
  16.     (abort
  17.       (cat
  18.     "You must install \"" #program "\" first!\n"
  19.     "It must be accessible via the path.\n"
  20.     "You can find it in the WHDLoad package."
  21.       )
  22.     )
  23.   )
  24. )
  25.  
  26. ;----------------------------
  27. ; Wait for inserting disk
  28. ; IN:  #AD_disk - name of disk
  29. ; OUT: -
  30.  
  31. (procedure P_disk
  32.   (askdisk
  33.     (dest #AD_disk)
  34.     (prompt ("\nInsert Disk \"%s\" in any drive!" #AD_disk))
  35.     (help @askdisk-help)
  36.   )
  37. )
  38.  
  39. ;****************************
  40.  
  41. (if
  42.   (exists #readme-file)
  43.   (if
  44.     (= 0 (run ("SYS:Utilities/Multiview %s" #readme-file)))
  45.     ("")
  46.     (run ("SYS:Utilities/More %s" #readme-file))
  47.   )
  48. )
  49.  
  50. (set #program "WHDLoad")
  51. (P_ChkRun)
  52.  
  53. (set @default-dest
  54.   (askdir
  55.     (prompt ("Where should \"%s\" be installed?\nA drawer \"%s\" will be automatically created." @app-name @app-name))
  56.     (help @askdir-help)
  57.     (default @default-dest)
  58.     (disk)
  59.   )
  60. )
  61. (set #dest (tackon @default-dest @app-name))
  62. (if
  63.   (exists #dest)
  64.   (
  65.     (set #choice
  66.       (askbool
  67.         (prompt ("\nDirectory \"%s\" already exists.\n Should it be deleted?" #dest))
  68.         (default 1)
  69.         (choices "Delete" "Skip")
  70.         (help @askbool-help)
  71.       )
  72.     )
  73.     (if
  74.       (= #choice 1)
  75.       (run ("Delete \"%s\" \"%s.info\" All" #dest #dest))
  76.     )
  77.   )
  78. )
  79. (makedir #dest
  80.   (help @makedir-help)
  81.   (infos)
  82. )
  83.  
  84. ;----------------------------
  85.  
  86. (copyfiles
  87.   (help @copyfiles-help)
  88.   (source ("%s.Slave" @app-name))
  89.   (dest #dest)
  90. )
  91. (if
  92.   (exists ("%s.newicon" @app-name))
  93.   (set #icon
  94.     (askchoice
  95.       (prompt "\nWhich icon would you like to install?\n")
  96.       (default 0)
  97.       (choices "Normal" "NewIcon")
  98.       (help @askchoice-help)
  99.     )
  100.   )
  101.   (set #icon 0)
  102. )
  103. (select #icon
  104.   (set #icon ("%s.inf" @app-name))
  105.   (set #icon ("%s.newicon" @app-name))
  106. )
  107. (copyfiles
  108.   (help @copyfiles-help)
  109.   (source #icon)
  110.   (newname ("%s.info" @app-name))
  111.   (dest #dest)
  112. )
  113. (if
  114.   (exists #readme-file)
  115.   (copyfiles
  116.     (help @copyfiles-help)
  117.     (source #readme-file)
  118.     (dest #dest)
  119.   )
  120. )
  121. (if
  122.   (exists ("%s.info" #readme-file))
  123.   (copyfiles
  124.     (help @copyfiles-help)
  125.     (source ("%s.info" #readme-file))
  126.     (dest #dest)
  127.   )
  128. )
  129. (if
  130.   (= #sub-dir "")
  131.   ("")
  132.   (
  133.     (set #dest (tackon #dest #sub-dir))
  134.     (makedir #dest
  135.       (help @makedir-help)
  136.     )
  137.   )
  138. )
  139.  
  140. ;----------------------------
  141.  
  142. (set #AD_disk "Forgotten...By_Mirage_1992")
  143. (P_disk)
  144. (copyfiles
  145.   (help @copyfiles-help)
  146.   (source ("%s:" #AD_disk))
  147.   (dest #dest)
  148.   (pattern "~(00)")
  149. )
  150.  
  151. ;----------------------------
  152.  
  153. (run ("Delete %s ALL QUIET FORCE" #cleanup))
  154.  
  155. (exit)
  156.